import Vue from 'vue'
import VueRouter from 'vue-router'
const Login = () => import(/* webpackChunkName: "login_home_welcome" */ '../views/Login/login.vue')
const Home = () => import(/* webpackChunkName: "login_home_welcome" */ '../views/Home')
const Index = () => import(/* webpackChunkName: "login_home_welcome" */ '../views/Home/Homepage')
const Questions = () => import(/* webpackChunkName: "login_home_welcome" */ '../views/Home/Questions')
const Video = () => import(/* webpackChunkName: "login_home_welcome" */ '../views/Home/Video')
const My = () => import(/* webpackChunkName: "login_home_welcome" */ '../views/Home/My')
Vue.use(VueRouter)
const routes = [
  { path: '/login', component: Login },
  { path: '/', redirect: '/login' },
  {
    path: '/home',
    component: Home,
    children: [
      { path: '/home/index', component: Index },
      { path: '/home/questions', component: Questions },
      { path: '/home/video', component: Video },
      { path: '/home/my', component: My }
    ]
  },
  { path: '/home/search', component: () => import('../views/Home/Homepage/components/search') },
  { path: '/articleParticulars/:articleId', component: () => import('../views/Home/Homepage/components/particulars'), props: true },
  { path: '/myedit/:userId', component: () => import('../views/Home/My/components/edit'), props: true },
  { path: '/user/:userId', component: () => import('../components/user'), props: true }
]

const router = new VueRouter({
  routes
})

export default router
